<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>5-3 for...in 遍历对像的属性</title>
</head>
<body>
<script>
var books = {};
books.title1 = "《JavaScript前端开发案例教程》";
books.title2 = "《Node.js核心基础教程》";
books.title3 = "《HTML5移动web开发》";
for (var prop in books){
    if (books.hasOwnProperty(prop)){
        console.log(prop + ":" + books[prop]);
    }
}
</script>
</body>
</html>